﻿using blackhouse.WebNemo.Business.Groups;
using System;
using System.Web.UI.WebControls;

namespace blackhouse.WebNemo.Web.Controls
{
   

    public class DateDisplayRecordValue : DisplayRecordValue
    {
        private Literal display;

        protected override void PopulateControl()
        {
            DateTime dt = DateTime.MinValue;
            string dtF = "";
            dt = base.record.GetDateTime(base.column.ColumnName);
            if (base.column.ColumnType == FieldType.DateField)
            {
                dtF = "D";
            }
            else
            {
                dtF = "F";
            }
            this.DisplayControl.Text = dt.ToString(dtF);
        }

        private Literal DisplayControl
        {
            get
            {
                if (this.display == null)
                {
                    this.display = new Literal();
                    this.Controls.Add(this.display);
                }
                return this.display;
            }
        }
    }
}

